﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LimitlessConnector
{
  /// <summary>
  /// Commands for the RGBW light bulb (dated Feb 4th, 2014)
  /// Source: http://www.limitlessled.com/dev
  /// Copyright (2013) Limitless Designs
  /// If the commandset codes are utilized in any way, the LimitlessLED website url must remain in the code comments.
  /// </summary>
  public static class LimitlessRGBWCommands
  {
    /// <summary>
    /// Enables all groups
    /// </summary>
    public static byte[] Enable_All = new byte[] { 0x42, 0x00, 0x55 };
    /// <summary>
    /// Disables all groups
    /// </summary>
    public static byte[] Disable_All = new byte[] { 0x41, 0x00, 0x55 };
    /// <summary>
    /// Decreases the speed of the program
    /// </summary>
    public static byte[] SpeedDecrease = new byte[] { 0x43, 0x00, 0x55 };
    /// <summary>
    /// Increases the speed of the program
    /// </summary>
    public static byte[] SpeedIncrease = new byte[] { 0x44, 0x00, 0x55 };
    /// <summary>
    /// Enables bulbs in group 1
    /// </summary>
    public static byte[] Enable_Group1 = new byte[] { 0x45, 0x00, 0x55 };
    /// <summary>
    /// Enables bulbs in group 2
    /// </summary>
    public static byte[] Enable_Group2 = new byte[] { 0x47, 0x00, 0x55 };
    /// <summary>
    /// Enables bulbs in group 3
    /// </summary>
    public static byte[] Enable_Group3 = new byte[] { 0x49, 0x00, 0x55 };
    /// <summary>
    /// Enables bulbs in group 4
    /// </summary>
    public static byte[] Enable_Group4 = new byte[] { 0x4B, 0x00, 0x55 };
    /// <summary>
    /// Disables bulbs in group 1
    /// </summary>
    public static byte[] Disable_Group1 = new byte[] { 0x46, 0x00, 0x55 };
    /// <summary>
    /// Disables bulbs in group 2
    /// </summary>
    public static byte[] Disable_Group2 = new byte[] { 0x48, 0x00, 0x55 };
    /// <summary>
    /// Disables bulbs in group 3
    /// </summary>
    public static byte[] Disable_Group3 = new byte[] { 0x4A, 0x00, 0x55 };
    /// <summary>
    /// Disables bulbs in group 4
    /// </summary>
    public static byte[] Disable_Group4 = new byte[] { 0x4C, 0x00, 0x55 };
    /// <summary>
    /// Enables the pre-configured program mode and switches programs
    /// </summary>
    public static byte[] Program = new byte[] { 0x4D, 0x00, 0x55 };
    /// <summary>
    /// Gets the brightness command.
    /// </summary>
    /// <param name="Brightness">The brightness. Values from 2 to 27 are valid.</param>
    /// <returns></returns>
    public static byte[] GetBrightnessCommand(int Brightness)
    {
      return new byte[] { 0x4E, (byte)Brightness, 0x55 };
    }
    /// <summary>
    /// Gets the color command.
    /// </summary>
    /// <param name="Color">The color. Values from 0 to 255 are valid.</param>
    /// <returns></returns>
    public static byte[] GetColorCommand(int Color)
    {
      return new byte[] { 0x40, (byte)Color, 0x55 };
    }
  }
}
